import ZZYRequest from '../index'


//登陆
export function getcontent(account) {
  return ZZYRequest.get({
    url: '/login',
    data: account
  })
}

//文章查询
export function getessay(lm) {
  return ZZYRequest.get({
    url: '/article',
    params: lm
  })
}
//赞同文章
export function putarticle(params) {
  return ZZYRequest.put({
    url:"/endorse",
    params
  })
}

//新增文章 
export function putanswer(payload){
  return ZZYRequest.post({
    url:"/article",
    data:payload
  })
}
//回答文章
export function articlereply(payload) {
  return ZZYRequest.post({
    url:"/article/reply",
    data:payload
  })
}
//获取文章回答
export function getarticlereply(params) {
  console.log(params,'params');
  return ZZYRequest.get({
    url:"/article/reply",
    params
  })
}
export function getallarticlereply(params) {
  return ZZYRequest.get({
    url:"/article/allreply",
    params
  })
}

//获得评论
export function getcommentlist(id){
  return ZZYRequest.get({
    url:"/article/comment",
    params:id
  })
}
//添加评论 
export function setcomment(payload) {
  return ZZYRequest.post({
    url:"/article/setcomment",
    data:payload
  })
}

//大文件上传 
export function postfile(payload) {
  return ZZYRequest.post({
    url:"/file",
    data: payload,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
export function getfilename(userid){
  return ZZYRequest.get({
    url:`${userid}/filename`,
  })
}
export function Deletefile (data) {
  return ZZYRequest.delete({
    url:`/deletefile`,
    data
  })
}
export function editinfo (data){
  return ZZYRequest.post({
    url:'/editinfo',
    data
  })
}

//上传视频文件 
export function postvideo (video) {
  return ZZYRequest.post({
    url:"/video",
    data:video,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

//关注作者 
export function attention(id) {
  return ZZYRequest.put({
    url:"/attention",
    params:id
  })
}
//查询关注粉丝
export function getattentions(id) {
  return ZZYRequest.get({
    url:"/attentions",
    params:id
  })
}





//测试
export function zzyfile(payload) {
  return ZZYRequest.post({
    url:"/zzyfile",
    data: payload,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

//测试获取 
export function redirect(params) {
  return ZZYRequest.get({
    url:'/ddlog',
    params
  })
}

